Device Controls
Background
The Device Controls API is useful for performing actions and operations on a device. Some examples include device, rebootDevice, factoryReset, and deleteDevices.
Since this API grouping is focused on device actions, you'll notice there are more mutations than queries when you reference the Use Cases & Supported APIs page.
Reboot a Single Device using rebootDevice
rebootDevice
accepts two arguments:
deviceId
: The uniqueId
of the device to rebootincludeLinkedDevices
: Defaults tofalse
. When set totrue
, devices linked (paired) to Poly OS devices will also reboot (e.g., TC8 & TC10).
Running this mutation will immediately terminate all active calls on the device. The device will go offline and remain unavailable during the boot process.
Test this query in the GraphQL Playground
mutation reboot($deviceId: String!) {
rebootDevice(deviceId: $deviceId) {
error
success
}
}
Variables
{
"deviceId": "00e0fr775sd0", //Studio X52
"includeLinkedDevices": true //reboot the TC8 and TC10 paired to the Studio X52
}
Response
{
"data": {
"rebootDevice": {
"error": null,
"success": true
}
}
}
Reboot all Devices in a Site Using rebootBySite
If you need to reboot all devices in a Site, you can use the rebootBySite
mutation.
Test this query in the GraphQL Playground
mutation rebootBySite($siteId: String!) {
rebootDevicesBySiteId(siteId: $siteId) {
error
success
}
}
Variables
{
"siteId": "b25a9126-45f4-4fl0-451a-56c06po1w74g"
}
Response
{
"data": {
"rebootDevicesBySiteId": {
"error": null,
"success": true
}
}
}
Update Device Metadata using updateDevice
If you need to update a device name, room, or site details, you can use the updateDevice
mutation.
Test this query in the GraphQL Playground
mutation updateDeviceName($fields: UpdateDeviceRequest!, $updateDeviceId: String!) {
updateDevice(fields: $fields, id: $updateDeviceId) {
name
}
}
Variables
{
"fields": {
"name": "DR Dev Lab Studio X70"
},
"updateDeviceId": "00e0fr775sd0"
}
Response
{
"data": {
"updateDevice": {
"name": "DR Dev Lab Studio X70"
}
}
}
If you have questions about usage, authentication, or integration with the Poly Lens APIs, contact us.